import { message, Radio,Modal} from "antd";
import { ProFormRadio, ProFormText, ProFormUploadButton} from "@ant-design/pro-form";
import {AddAdmin} from "@/services/ant-design-pro/management";
import React from "react";
const AddCourier = (props) => {
  const { isedit,issetEdit } = props
  return (
    <Modal<{
      name: string;
      company: string;
    }>
      visible={isedit}
      onCancel={() => {issetEdit(false)}}
      title="添加配送员"
      modalProps={ {
        onCancel:() => {issetEdit(false)}
      } }
      onFinish={async (values) => {
        AddAdmin(values)
        message.success('添加成功');
        return issetEdit(false);
      }}
    >
      <div style={ {marginLeft: '0px'} }>
          <ProFormUploadButton
            name='P_pic'
            label="配送员头像"
            tooltip="配送员头像"
            fieldProps={ {listType: 'picture-card'} }
            max={1}
            action="/upload.do"/>
      </div>
      <div>
        <ProFormText
          name="name"
          label='配送员名称'
          tooltip="配送员名称"
          placeholder='配送员名称'
        />
      </div>
      <div>
        <ProFormText
          name="phone"
          label='手机号码'
          tooltip="手机号码"
          placeholder='手机号码'
        />
      </div>
      <div>
        <ProFormRadio.Group
          name="radio-code"
          label="配送员状态"
          tooltip="配送员状态"
        >
          <Radio.Group defaultValue={1}>
            <Radio value={1}>显示</Radio>
            <Radio value={2}>隐藏</Radio>
          </Radio.Group>
        </ProFormRadio.Group>
      </div>
    </Modal>
  )
}
export default AddCourier
